package com.project.sadari.util;

import android.content.Context;
import android.content.SharedPreferences;

public class SharedPreUtil {
	
	static public String SHARED_PREF_NAME = "SadariGame";
	
	static public String PREF_CHK1_INPUT = "chk1Input";
	static public String PREF_CHK1_WIN = "chk1Win";

	static public String PREF_CHK2_USE = "chk2Use";
	static public String PREF_CHK2_DISUSE = "chk2Disuse";

	static public String PREF_CHK3_USE = "chk3Use";
	static public String PREF_CHK3_DISUSE = "chk3Disuse";
	
	static public String PREF_CHK4_USE = "chk4Use";
	static public String PREF_CHK4_DISUSE = "chk4Disuse";
	
	static public String PREF_CHK5_USE = "chk5Use";
	static public String PREF_CHK5_DISUSE = "chk5Disuse";
	
	
	/**
	 * chk1_Input get/set
	 * @param context
	 * @return b
	 */
	static public void setChk1Input(Context context, boolean b){
		SharedPreferences.Editor editor = context.getSharedPreferences(SHARED_PREF_NAME, 0).edit();
		editor.putBoolean(PREF_CHK1_INPUT, b);
		editor.commit();
	}
	static public boolean getChk1Input(Context context){
		return context.getSharedPreferences(SHARED_PREF_NAME, 0).getBoolean(PREF_CHK1_INPUT, true);
	}

	/**
	 * chk1_Win get/set
	 * @param context
	 * @return b
	 */
	static public void setChk1Win(Context context, boolean b){
		SharedPreferences.Editor editor = context.getSharedPreferences(SHARED_PREF_NAME, 0).edit();
		editor.putBoolean(PREF_CHK1_WIN, b);
		editor.commit();
	}
	static public boolean getChk1Win(Context context){
		return context.getSharedPreferences(SHARED_PREF_NAME, 0).getBoolean(PREF_CHK1_WIN, false);
	}
	
	/**
	 * chk2_Use get/set
	 * @param context
	 * @return b
	 */
	static public void setChk2Use(Context context, boolean b){
		SharedPreferences.Editor editor = context.getSharedPreferences(SHARED_PREF_NAME, 0).edit();
		editor.putBoolean(PREF_CHK2_USE, b);
		editor.commit();
	}
	static public boolean getChk2Use(Context context){
		return context.getSharedPreferences(SHARED_PREF_NAME, 0).getBoolean(PREF_CHK2_USE, true);
	}
	
	/**
	 * chk2_Disuse get/set
	 * @param context
	 * @return b
	 */
	static public void setChk2Disuse(Context context, boolean b){
		SharedPreferences.Editor editor = context.getSharedPreferences(SHARED_PREF_NAME, 0).edit();
		editor.putBoolean(PREF_CHK2_DISUSE, b);
		editor.commit();
	}
	static public boolean getChk2Disuse(Context context){
		return context.getSharedPreferences(SHARED_PREF_NAME, 0).getBoolean(PREF_CHK2_DISUSE, false);
	}
	
	/**
	 * chk3_Use get/set
	 * @param context
	 * @return b
	 */
	static public void setChk3Use(Context context, boolean b){
		SharedPreferences.Editor editor = context.getSharedPreferences(SHARED_PREF_NAME, 0).edit();
		editor.putBoolean(PREF_CHK3_USE, b);
		editor.commit();
	}
	static public boolean getChk3Use(Context context){
		return context.getSharedPreferences(SHARED_PREF_NAME, 0).getBoolean(PREF_CHK3_USE, true);
	}
	
	/**
	 * chk3_Disuse get/set
	 * @param context
	 * @return b
	 */
	static public void setChk3Disuse(Context context, boolean b){
		SharedPreferences.Editor editor = context.getSharedPreferences(SHARED_PREF_NAME, 0).edit();
		editor.putBoolean(PREF_CHK3_DISUSE, b);
		editor.commit();
	}
	static public boolean getChk3Disuse(Context context){
		return context.getSharedPreferences(SHARED_PREF_NAME, 0).getBoolean(PREF_CHK3_DISUSE, false);
	}
	
	/**
	 * chk4_Use get/set
	 * @param context
	 * @return b
	 */
	static public void setChk4Use(Context context, boolean b){
		SharedPreferences.Editor editor = context.getSharedPreferences(SHARED_PREF_NAME, 0).edit();
		editor.putBoolean(PREF_CHK4_USE, b);
		editor.commit();
	}
	static public boolean getChk4Use(Context context){
		return context.getSharedPreferences(SHARED_PREF_NAME, 0).getBoolean(PREF_CHK4_USE, true);
	}
	
	/**
	 * chk4_Disuse get/set
	 * @param context
	 * @return b
	 */
	static public void setChk4Disuse(Context context, boolean b){
		SharedPreferences.Editor editor = context.getSharedPreferences(SHARED_PREF_NAME, 0).edit();
		editor.putBoolean(PREF_CHK4_DISUSE, b);
		editor.commit();
	}
	static public boolean getChk4Disuse(Context context){
		return context.getSharedPreferences(SHARED_PREF_NAME, 0).getBoolean(PREF_CHK4_DISUSE, false);
	}
	
	/**
	 * chk5_Use get/set
	 * @param context
	 * @return b
	 */
	static public void setChk5Use(Context context, boolean b){
		SharedPreferences.Editor editor = context.getSharedPreferences(SHARED_PREF_NAME, 0).edit();
		editor.putBoolean(PREF_CHK5_USE, b);
		editor.commit();
	}
	static public boolean getChk5Use(Context context){
		return context.getSharedPreferences(SHARED_PREF_NAME, 0).getBoolean(PREF_CHK5_USE, false);
	}
	
	/**
	 * chk5_Disuse get/set
	 * @param context
	 * @return b
	 */
	static public void setChk5Disuse(Context context, boolean b){
		SharedPreferences.Editor editor = context.getSharedPreferences(SHARED_PREF_NAME, 0).edit();
		editor.putBoolean(PREF_CHK5_DISUSE, b);
		editor.commit();
	}
	static public boolean getChk5Disuse(Context context){
		return context.getSharedPreferences(SHARED_PREF_NAME, 0).getBoolean(PREF_CHK5_DISUSE, false);
	}
}
